{% extends "base.html" %}

{% block head-title %}{{algorithm.algorithm_name}}{% endblock %}

{% block title %}{{algorithm.algorithm_name}}{% endblock %}

{% block content %}

<div style="float: right;">
	<a href="/static/{{algorithm.instance_id}}/raw_data.xlsx"
		class="uk-button uk-button-success" target="_blank">原始数据</a>
	<a href="/static/{{algorithm.instance_id}}/new_data.xlsx"
		class="uk-button uk-button-danger" target="_blank">处理后数据</a>
	<a href="/show_source_code?instance_id={{algorithm.instance_id}}"
		class="uk-button uk-button-primary" target="_blank">源代码</a>
</div>

<h2>原始数据</h2>
<table class="uk-table uk-table-striped">
	<caption>记录数:{{algorithm.data_source_size}}</caption>
	<thead>
		<tr>
			<th>序号</th> 
			{% for column in algorithm.data_source.columns %}
			<th>{{ column }}</th> 
			{% endfor %}
		</tr>
	</thead>
	<tbody>
		{% for values in algorithm.data_source.head.values %}
		<tr>
			<td>{{ forloop.counter }}</td>
			{% for value in values%}
			<td>{{ value }}</td>
			{% endfor %}
		</tr>
		{% endfor %}
	</tbody>
</table>
<hr />

<h2>处理后数据</h2>
<table class="uk-table uk-table-striped">
	<caption>记录数:{{algorithm.new_data.shape.0}}</caption>
	<thead>
		<tr>
			<th>序号</th> 
			{% for column in algorithm.new_data.columns %}
			<th>{{ column }}</th> 
			{% endfor %}
		</tr>
	</thead>
	<tbody>
		{% for values in algorithm.new_data.head.values %}
		<tr>
			<td>{{ forloop.counter }}</td>
			{% for value in values%}
			<td>{{ value }}</td>
			{% endfor %}
		</tr>
		{% endfor %}
	</tbody>
</table>
<hr />

{% endblock %}